import config
from api.login import LoginApi
import unittest

class TestLogin_success(unittest.TestCase):
    def setUp(self):
        self.loginApi=LoginApi()

    def test_login_success(self):
        loginData={
            "mobile": "13800000002",
            "password": "123456"
        }
        #提取token数据
        response=self.loginApi.login(loginData)
        print(response.json())
        self.assertEqual(True,response.json().get("success"))
        config.TOKEN="Bearer "+response.json().get("data")
        config.headers_data["Authorization"]=config.TOKEN
        print(config.headers_data["Authorization"])